<include file="Common:header"/>
    <div class="container content">
      <if condition="I('get.id') eq null">
        <form action="{:U('Article/addArticle')}" method="post">
      <else/>
        <form action="{:U('Article/updateArticle')}" method="post">
          <input type="hidden"  value="{:I('get.id')}" name="id" value="">
      </if>
        <div class="form-group">
              <label>文章标题</label>
              <input name="title" value="{$article.title}" type="text" class="form-control" >
        </div>
        <div class="form-group">
              <label>简介</label>
              <input name="about" value="{$article.about}" type="text" class="form-control"  >
        </div>
        <div class="form-group">
          <label >分类<a href="javascript:;"   data-toggle="modal" data-target=".bs-example-modal-lg">添加分类</a></label>
           <select name="cid" data-toggle="select" class="form-control select select-primary ">
               <foreach name="cates" item="v">
                 <option value="{$v.id}">{$v.name}</option>
               </foreach>
           </select>
         </div>
         <div class="form-group">
               <label>文章内容</label>
               <textarea name="content" id="textarea">{$article.content}</textarea>
         </div>
         <if condition="I('get.id') eq null">
           <button type="submit" class="btn btn-primary btn-lg btn-block"  >发布</button>
         <else/>
           <button type="submit" class="btn btn-primary btn-lg btn-block">提交修改</button>
         </if>
      </form>
    </div>
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
  <div class="modal-dialog modal-lg">
    <form action="{:U('Article/addCate')}" method="post">
    <div class="modal-content">
      <h6>添加分类</h6>
      <div class="form-group">
            <label>级别</label>
            <input name="lv" type="number" class="form-control"  >
            <label>分类名称 </label>
            <input name="name" type="text" class="form-control" >
      </div>
        <button type="submit" class="btn btn-primary btn-lg btn-block">添加</button>
    </div>
    </form>
  </div>
</div>

<include file="Common:js"/>

<script src="__PUBLIC__/js/wangEditor.min.js" charset="utf-8"></script>
<script type="text/javascript">
var editor = new wangEditor('textarea');
 editor.create();
</script>
</body>
</html>
